<?php

namespace App\Admin\Extensions\Form;

use Dcat\Admin\Form\Field;
use Dcat\Admin\Widgets\Checkbox;
class LeftRightVision extends Field
{
    protected $view = 'admin.form.left-right-vision';

    public function render()
    {
        $model = $this->values();
        $column = $this->column;
        $left = $column . '_left';
        $right = $column . '_right';

        $fields_arr = ['shili_luoyang', 'shili_luoyan', 'shili_jiaozheng', 'yanguang_xiaotong', 'yanguang_wushi', 'jiujing_jiaodu'];
        $this->addVariables([
            'value' => $model?$model[$column]:'',
            'left' => $model?$model[$left]:'',
            'right' => $model?$model[$right]:'',
            'fields_arr'=> $fields_arr,
        ]);

        return parent::render();

    }
}